fetcher: Hold a ref to main context for lifetime of thread
authorColin Walters <walters@verbum.org>
Fri, 8 Jul 2016 14:01:47 +0000 (10:01 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 8 Jul 2016 18:38:11 +0000 (18:38 +0000)
commitb4c15209e846aaf3bfdbf12eddea3dd1d9a46226
tree7e87d76b1f51df130cd500d93b329ca4806ab20b
parentd7629d33a4bdd17816a25f13a09865cfb6248d1f
fetcher: Hold a ref to main context for lifetime of thread

I don't think this fixes the bug I was seeing, but it makes me more
comfortable to know we have a strong ref to the main context across
the thread lifetime, and we only unset the default right before
we go away.

If something in `thread_closure_unref()` used
`g_main_context_get_thread_default()` for example it'd be wrong
before.

Closes: #383
Approved by: mbarnes
src/libostree/ostree-fetcher.c